$(function(){
	layui.use('form',function(){
		
		var	form=layui.form;
		form.val("form1",{
			"userId" : $("#test").text()
			
		})
		
		form.on('submit(btn12)',function(data){
			var formData = data.field;
			var userId=formData.userId;
			var repw=formData.repw;
			var repw1=formData.repw1;
			console.log(userId);
			console.log(repw);
			console.log(repw1);
			if(repw!=null && repw!=null && repw!='' && repw1!='' && repw==repw1){
				$.ajax({
					url:'/updatePassword',
					dataType:'json',
					type:'post',
					data:{
						userId:userId,
						repw:repw			
					},
					success:function(){
						layer.msg("修改成功");
					},
					error:function(){
						layer.msg("系统错误11");
						
					}
				})

			}else{
				layer.msg("请填写完整再提交");
			}
		})
		
		

	})
	
})